//
//  AppDelegate.swift
//  Weibo
//
//  Created by mac on 16/3/10.
//  Copyright © 2016年 hw.chow. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        
        //利用类方法加载已经保存的用户数据信息
        print(UserAccount.loadUserAccount())
        
        //渲染文字颜色
        setThemeColor()
        
        //实例化一个window
        window = UIWindow(frame: UIScreen .mainScreen().bounds)
        //设置背景颜色
        window?.backgroundColor = UIColor.whiteColor()
        //设置视图根控制器
        window?.rootViewController = MainViewController()
        
        //使窗口可见
        window?.makeKeyAndVisible()
        
        return true
    }

    //渲染文字颜色（全局渲染）
    //必须要在视图实例化之前进行设置
    private func setThemeColor(){
    
        //设置导航控制器的全局颜色
        UINavigationBar.appearance().tintColor = UIColor.orangeColor()
    }
    

}

